{% extends "layout.html" %}

{% block body %}
  {% if title or subtitle or text or show_input %}
  <header class="jumbotron masthead">
    {% if title %}<h1>{{ title }}</h1>{% endif %}
    {% if subtitle %}<h2>{{ subtitle }}</h2>{% endif %}
    {% if text %}
    {{ text | markdown | safe }}
    {% endif %}
    {% if show_input %}
    <div class="row">
      <div class="col-md-10 col-md-offset-1">
        <form method="post" action="{{ from_base('/create/') }}">
          <div class="input-group">
            <input class="form-control"
             id="main-input"
             type="text"
             name="gistnorurl"
             autofocus="autofocus"
             placeholder="URL | GitHub username | GitHub username/repo | Gist ID"/>
            <span class="input-group-btn">
              <button class="btn btn-default" type="submit" type="button">
                Go!
              </button>
            </span>
          </div>
        </form>
      </div>
    </div>
    {% endif %} 
  </header>
  {% endif %}

  {% for section in sections %}
    <section>
      <h3 class="section-heading">{{section.header}}</h3>
      <div class="marketing">
        <ul class="thumbnails example-sites">
          {% for link in section.links %}
            <li class="col-md-4">
              <p class="marketing-byline">{{link.text}}</p>
              <a class="thumbnail" href="{{ from_base(link.target) }}" target="_blank">
                <img src="{{ from_base(link.img) }}" />
              </a>
            </li>
          {% endfor %}
        </ul>
      </div>
    </section>
  {% endfor %}

{% endblock body %}
